package com.example.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;

/**
 * 交易流水表
 */
@Data
@TableName(value = "tb_transaction", autoResultMap = true)
public class Transaction {
    public Long getId() { return id; }
    public void setId(Long id) { this.id = id; }
    public String getTxHash() { return txHash; }
    public void setTxHash(String txHash) { this.txHash = txHash; }
    public String getFromAddress() { return fromAddress; }
    public void setFromAddress(String fromAddress) { this.fromAddress = fromAddress; }
    public String getToAddress() { return toAddress; }
    public void setToAddress(String toAddress) { this.toAddress = toAddress; }
    public java.math.BigDecimal getValue() { return value; }
    public void setValue(java.math.BigDecimal value) { this.value = value; }
    public String getContractAddress() { return contractAddress; }
    public void setContractAddress(String contractAddress) { this.contractAddress = contractAddress; }
    public Long getBlockNumber() { return blockNumber; }
    public void setBlockNumber(Long blockNumber) { this.blockNumber = blockNumber; }
    public Long getGasPrice() { return gasPrice; }
    public void setGasPrice(Long gasPrice) { this.gasPrice = gasPrice; }
    public Long getGasUsed() { return gasUsed; }
    public void setGasUsed(Long gasUsed) { this.gasUsed = gasUsed; }
    public Integer getStatus() { return status; }
    public void setStatus(Integer status) { this.status = status; }
    public String getRawTx() { return rawTx; }
    public void setRawTx(String rawTx) { this.rawTx = rawTx; }
    public java.util.Date getTxTime() { return txTime; }
    public void setTxTime(java.util.Date txTime) { this.txTime = txTime; }
    public java.util.Date getCreateTime() { return createTime; }
    public void setCreateTime(java.util.Date createTime) { this.createTime = createTime; }
    public java.util.Date getUpdateTime() { return updateTime; }
    public void setUpdateTime(java.util.Date updateTime) { this.updateTime = updateTime; }

    @TableId(type = IdType.AUTO)
    private Long id;

    /** 交易哈希 */
    private String txHash;

    /** 发送方地址 */
    private String fromAddress;

    /** 接收方地址 */
    private String toAddress;

    /** 转账金额（ETH或Token） */
    private BigDecimal value;

    /** 合约地址（ETH为空，ERC20为合约地址） */
    private String contractAddress;

    /** 区块号 */
    private Long blockNumber;

    /** Gas价格（Wei） */
    private Long gasPrice;

    /** 实际消耗Gas */
    private Long gasUsed;

    /** 交易状态（0失败 1成功） */
    private Integer status;

    /** 原始完整交易信息(JSON) */
    private String rawTx;

    /** 交易时间 */
    private Date txTime;

    /** 创建时间 */
    private Date createTime;

    /** 更新时间 */
    private Date updateTime;

}
